const express = require('express');
const noteRouter = require('./routes/noteRouter');
const noteApiRouter = require('./routes/noteApiRouter');
const loginRouter = require('./routes/loginRouter');
const bodyParser = require('body-parser');

const app = express();
// 配置获取请求体中间件
app.use(bodyParser.urlencoded({extended:false}))
// 配置静态资源文件目录
app.use(express.static(__dirname+'/public'));
app.set('view engine','ejs');
app.set('views','./views');

app.use(loginRouter)
// 调用页面router
app.use(noteRouter)
// 调用note接口router
app.use(noteApiRouter)

app.listen(80,()=>{
    console.log('启动成功');
})

